﻿using System;
using GalaSoft.MvvmLight.Command;

namespace Dsl.Ped.Common.Commands
{
    /// <summary>
    /// Implementation of common menu command which can be used like an object 
    /// bound in menu items colletion,...
    /// </summary>
    public class MenuCommand : RelayCommand, IMenuCommand
    {
        #region Members

        /// <summary>
        /// Name of the command
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// Description of the command (can be used like a tooltip, help...)
        /// </summary>
        public string Description { get; set; }

        #endregion

        #region Constructors

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="name">Name of the command</param>
        /// <param name="command">Command to be executed</param>
        /// <param name="description">Description of the command</param>
        public MenuCommand(string name, Action action, string description)
            : base(action)
        {
            Name = name;
            Description = description;
        }

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="name">Name of the command</param>
        /// <param name="command">Command to be executed</param>
        public MenuCommand(string name, Action action)
            : this(name, action, "")
        {
        }

        #endregion
    }
}
